<?php
/* 
 * Copyright (c) 2018-2021  * 
 * 创建时间：2021-04-24 06:14
 *
 * 项目：upload  -  $  - levssqController.php
 *
 * 作者：liwei 
 */


namespace modules\levpays\modules\alipay\controllers;

!defined('INLEV') && exit('Access Denied LEV');

use Lev;
use lev\base\Controllerv;
use lev\base\Viewv;
use modules\levpays\modules\alipay\sdk\Payment;
use modules\levpays\table\tradesHelper;

//require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'sdk/sdk/wappay/service/AlipayTradeService.php';

class DefaultController extends Controllerv {

    /**
     * Renders the index view for the module
     */
    public function actionIndex()
    {

        Lev::$app['title'] = '支付宝支付';

        if (Lev::GPv('payt') == 1) {
            Payment::wapPay(tradesHelper::getTradeno(time()), '测试', 0.01);
        }elseif (Lev::GPv('payt') == 2) {
            Payment::pcPay(tradesHelper::getTradeno(time()), '测试', 0.01);
        }

        Viewv::render('default/index', [
        ]);

    }

    public static function actionAjax() {
        echo json_encode(Lev::responseMsg(1, '', ['htms'=>'<tips class="flex-box ju-sa" style="height:100px">没有数据</tips>', 'not'=>1]));
    }
}